Hi Ray,
Yes see:
The example
Measure IRQ.c
uses a simple method of watching the time and when is sees a gap of more than 10us it knows it has been pre-empted.
There is also a counter which increments each servo interrupt where any change would indicate it has been pre-empted
extern volatile double ServoTick; // increments each servo interrupt
Regards
TK
Group: DynoMotion |
Message: 2612 |
From: himykabibble |
Date: 12/5/2011 |
Subject: Re: Thread Switching.... |
Tom,
Thanks. Having the ServoTick solves another problem for me as well.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
> Â
> Yes see:
> Â
> http://dynomotion.com/Help/Multitasking.htm
> Â
> The example
> Â
> Measure IRQ.c
> Â
> uses a simple method of watching the time and when is sees a gap of more than 10us it knows it has been pre-empted.
> Â
> There is also a counter which increments each servo interrupt where any change would indicate it has been pre-emptedÂ
> Â extern
> Â
> RegardsvolatiledoubleServoTick; // increments each servo interrupt
> TK
> Â
> From: himykabibble <jagboy@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, December 5, 2011 10:00 PM
> Subject: [DynoMotion] Thread Switching....
>
>
> Â
> Tom,
>
> Am I correct in assuming you are doing pre-emptive task switching, and that if a thread does not cede control before its timeslice is up, it will be suspended until its turn comes around again?
>
> Is there any way to *know* a thread has exceeded its timeslice?
>
> Regards,
> Ray L.
>
|
|
| |